<?php if(!empty($articles)):?>
	<?php
	$found = null;
	foreach($articles as $article):
		$user = $article['User'];
		if(!empty($article['Article'])) {
			$article = $article['Article'];
		}
		?>
	<h3><?php echo $html->link($article['title'],'/articles/view/' . $article['id'])?></h3>
	<div class="main">
		<span class="author">By <?php echo $html->link($user['username'], '/users/view/' .$user['id']);?></span>
		<?php echo $html->link('[Read more]', '/articles/view/'.$article['id'], array('title'=>"article permalink")); ?>
	</div>
</div>
	<?php endforeach;?>
<?php endif;?>